﻿
        function reloadGrid() {
            $('#tSortable').dataTable({
                "iDisplayLength": 5,
                "aLengthMenu": [5, 10, 25, 50, 100],
                "sPaginationType": "full_numbers",
                "iSortingCols": "STT"
            });
        }


        function Success(data)
        {
            if (data == "exist")
            {
                $.topAlertPopup({ "text": "The name of item existed", "typeAlert": "error" });
            }
            else
            {
                if (data != "")
                {
                    $.topAlertPopup({ "text": "Update completed", "typeAlert": "success" });
                    $('#ID').val(data.ID);
                    $('#Name').val(data.Name);
                
                    if (data.Active == false)
                    {
                        $('input[id=Active]').attr('checked', false);
                    }
                    else
                    {
                        $('input[id=Active]').attr('checked', true);
                    }
                   
                }
                else
                {
                    $.topAlertPopup({ "text": "Error, try agian please !", "typeAlert": "error" });
                }
            }
        }


       
